package com.example.demo.service.Impl;

import com.example.demo.common.utills.CommonResult;
import com.example.demo.entity.DataReports;
import com.example.demo.mapper.DataReportsMapper;
import com.example.demo.service.DataReportsService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class DataReportsServiceImpl  implements DataReportsService {

    @Resource
    DataReportsMapper dataReportsMapper;
    @Override
    public CommonResult selectAll(int pageNum, int pageSize, String name) {
        PageHelper.startPage(pageNum, pageSize);
        List<DataReports> list = dataReportsMapper.selectAll(name);
        PageInfo<List<DataReports>> pageInfo=new PageInfo(list);
        return new CommonResult(200,"查询成功",pageInfo);
    }
}
